﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Credit.aspx.cs" Inherits="Admin_Credit"
    Title="Credit" MasterPageFile="~/Shared/DefaultMaster.master" %>

<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"
    TagPrefix="pp" %>
<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">
		<h3>
            Asignaci&oacute;n de Cupos&nbsp;<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManagerCredit" runat="server">
        </ajaxToolkit:ToolkitScriptManager>
        <pp:ObjectContainerDataSource ID="CustomerContainerDataSource" runat="server" DataObjectTypeName="Metro.Admin.BusinessEntities.Customer" />
        <pp:ObjectContainerDataSource ID="CreditContainerDataSource" runat="server" DataObjectTypeName="Metro.Admin.BusinessEntities.Credit" OnDeleted="CreditContainerDataSource_Deleted" />
    </h3>
    <table>
        <tr>
            <td style="width: 100px">
                Cliente:</td>
            <td style="width: 100px">
                <asp:DropDownList ID="ddlCustomer" runat="server" DataSourceID="CustomerContainerDataSource"
                    DataTextField="Name" DataValueField="Id">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Tipo de Cupo:</td>
            <td style="width: 100px">
                <asp:DropDownList ID="ddlCreditType" runat="server">
                    <asp:ListItem Value="C">Compra</asp:ListItem>
                    <asp:ListItem Value="V">Venta</asp:ListItem>
                    <asp:ListItem Value="N">Neto</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Monto:</td>
            <td style="width: 100px">
                <asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>
                <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtenderAmount" runat="server" DisplayMoney="Left"
                    Mask="999,999,999,999,999" MaskType="Number" TargetControlID="txtAmount">
                </ajaxToolkit:MaskedEditExtender>
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
                <asp:Button ID="btnAdd" runat="server" Text="Agregar" OnClick="btnAdd_Click" /></td>
            <td style="width: 100px">
            </td>
        </tr>
    </table>
    <br />
    <asp:GridView ID="CreditGridView" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" DataSourceID="CreditContainerDataSource" GridLines="None" DataKeyNames="Id">
        <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ButtonType="Image" DeleteImageUrl="~/images/delete.png" />
            <asp:BoundField DataField="Type" HeaderText="Tipo" SortExpression="Type" />
            <asp:BoundField DataField="Amount" HeaderText="Monto" SortExpression="Amount" DataFormatString="{0:C}" />
            <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" Visible="False"/>
            <asp:BoundField DataField="CustomerName" HeaderText="Nombre de Cliente" SortExpression="CustomerName" />
            <asp:BoundField DataField="Date" HeaderText="Fecha" SortExpression="Date" DataFormatString="{0:D}" />
        </Columns>
        <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
        <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
    </asp:GridView>
</asp:Content>
